﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QLQTPM_Nhom03
{
    public partial class Form_DanhSach : Form
    {
        public Form_DanhSach()
        {
            InitializeComponent();
        }

        private void LB_CapNhatDuLieu_MouseEnter(object sender, EventArgs e)
        {
            Panel_CapNhatDuLieu_MouseEnter(sender, e);
        }

        private void LB_CapNhatDuLieu_MouseLeave(object sender, EventArgs e)
        {
            Panel_CapNhatDuLieu_MouseLeave(sender, e);
        }

        private void Panel_CapNhatDuLieu_MouseEnter(object sender, EventArgs e)
        {
            Panel_CapNhatDuLieu.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.staticbutton2_hover;
        }

        private void Panel_CapNhatDuLieu_MouseLeave(object sender, EventArgs e)
        {
            Panel_CapNhatDuLieu.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.staticbutton2;
        }

        private void PB_CapNhatDuLieu_MouseEnter(object sender, EventArgs e)
        {
            Panel_CapNhatDuLieu_MouseEnter(sender, e);
        }

        private void PB_CapNhatDuLieu_MouseLeave(object sender, EventArgs e)
        {
            Panel_CapNhatDuLieu_MouseLeave(sender, e);
        }

        private void PB_MouseEnter(object sender, EventArgs e)
        {
            PictureBox pb = (PictureBox)sender;

            switch (pb.Name)
            {
                case "PB_TatCa":
                    //PB_TatCa.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.icon_tatca;
                    PB_TatCa.Image = QLQTPM_Nhom03.Properties.Resources.icon_tatca_animation;
                    PB_Description.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.descript_tatca;
                    break;
                case "PB_ATM":
                    //PB_ATM.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.icon_atm;
                    PB_ATM.Image = QLQTPM_Nhom03.Properties.Resources.icon_atm_animation;
                    PB_Description.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.descript_atm;
                    break;
                case "PB_CayXang":
                    //PB_CayXang.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.icon_cayxang;
                    PB_CayXang.Image = QLQTPM_Nhom03.Properties.Resources.icon_cayxang_animation;
                    PB_Description.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.descript_cayxang;
                    break;
                case "PB_BenhVien":
                    //PB_BenhVien.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.icon_benhvien;
                    PB_BenhVien.Image = QLQTPM_Nhom03.Properties.Resources.icon_benhvien_animation;
                    PB_Description.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.descript_benhvien;
                    break;
                case "PB_NhaHang":
                    //PB_NhaHang.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.icon_nhahang;
                    PB_NhaHang.Image = QLQTPM_Nhom03.Properties.Resources.icon_nhahang_animation;
                    PB_Description.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.descript_nhahang;
                    break;
                case "PB_SieuThi":
                    //PB_SieuThi.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.icon_sieuthi;
                    PB_SieuThi.Image = QLQTPM_Nhom03.Properties.Resources.icon_sieuthi_animation;
                    PB_Description.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.descript_sieuthi;
                    break;
                case "PB_NganHang":
                    //PB_NganHang.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.icon_nganhang;
                    PB_NganHang.Image = QLQTPM_Nhom03.Properties.Resources.icon_nganhang_animation;
                    PB_Description.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.descript_nganhang;
                    break;
                case "PB_BuuDien":
                    //PB_BuuDien.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.icon_buudien;
                    PB_BuuDien.Image = QLQTPM_Nhom03.Properties.Resources.icon_buudien_animation;
                    PB_Description.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.descript_buudien;
                    break;
                case "PB_RapChieuPhim":
                    //PB_RapChieuPhim.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.icon_rapchieuphim;
                    PB_RapChieuPhim.Image = QLQTPM_Nhom03.Properties.Resources.icon_rapchieuphim_animation;
                    PB_Description.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.descript_rapchieuphim;
                    break;
                default:
                    pb.BackgroundImage = null;
                    break;
            }
            
        }

        private void PB_MouseLeave(object sender, EventArgs e)
        {
            PictureBox pb = (PictureBox)sender;

            PB_Description.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.descript_none;

            switch (pb.Name)
            {
                case "PB_TatCa":
                    //PB_TatCa.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.icon_tatca_hover;
                    PB_TatCa.Image = QLQTPM_Nhom03.Properties.Resources.icon_tatca_hover;
                    break;
                case "PB_ATM":
                    //PB_ATM.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.icon_atm_hover;
                    PB_ATM.Image = QLQTPM_Nhom03.Properties.Resources.icon_atm_hover;
                    break;
                case "PB_CayXang":
                    //PB_CayXang.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.icon_cayxang_hover;
                    PB_CayXang.Image = QLQTPM_Nhom03.Properties.Resources.icon_cayxang_hover;
                    break;
                case "PB_BenhVien":
                    //PB_BenhVien.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.icon_benhvien_hover;
                    PB_BenhVien.Image = QLQTPM_Nhom03.Properties.Resources.icon_benhvien_hover;
                    break;
                case "PB_NhaHang":
                    //PB_NhaHang.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.icon_nhahang_hover;
                    PB_NhaHang.Image = QLQTPM_Nhom03.Properties.Resources.icon_nhahang_hover;
                    break;
                case "PB_SieuThi":
                    //PB_SieuThi.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.icon_sieuthi_hover;
                    PB_SieuThi.Image = QLQTPM_Nhom03.Properties.Resources.icon_sieuthi_hover;
                    break;
                case "PB_NganHang":
                    //PB_NganHang.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.icon_nganhang_hover;
                    PB_NganHang.Image = QLQTPM_Nhom03.Properties.Resources.icon_nganhang_hover;
                    break;
                case "PB_BuuDien":
                    //PB_BuuDien.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.icon_buudien_hover;
                    PB_BuuDien.Image = QLQTPM_Nhom03.Properties.Resources.icon_buudien_hover;
                    break;
                case "PB_RapChieuPhim":
                    //PB_RapChieuPhim.BackgroundImage = QLQTPM_Nhom03.Properties.Resources.icon_rapchieuphim_hover;
                    PB_RapChieuPhim.Image = QLQTPM_Nhom03.Properties.Resources.icon_rapchieuphim_hover;
                    break;
                default:
                    pb.BackgroundImage = null;
                    break;
            }
        }

        private void PB_TatCa_Click(object sender, EventArgs e)
        {
            Point location = this.Location;
            Form_TimKiem form = new Form_TimKiem();
            form.Location = location;
            form.parent = this;

            while (this.Opacity > 0)
            {
                this.Opacity -= 0.3;
                System.Threading.Thread.Sleep(1);
                this.Refresh();                
            }

            this.Visible = false;
            this.Opacity = 1.0;
            form.Opacity = 0;
            form.Show();

            while (form.Opacity < 1.0)
            {
                form.Opacity += 0.3;
                System.Threading.Thread.Sleep(1);
                form.Refresh();
            }
        }
    }
}
